package com.cookie.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/*
*
* ip: 127.0.0.1
port: 6379
auth: abc123
max-active: 1024
max-idle: 200
max-wait: 10000
* */
@Component
@ConfigurationProperties(prefix = "redis.conf")
public class RedisConfig {
    private boolean cluster;
    private String addrs;
    private String ip;
    private int port;
    private String auth;
    private int maxActive;
    private int maxIdle;
    private int maxWait;
    // 新增的参数
    private boolean useDbnameAsPrefix;
    private String prefix;
    private boolean useLowerCase;
    private boolean saveNull;

    // 这里默认生成的是 isVar, 而不是getVar
    public boolean isCluster() {
        return cluster;
    }

    public void setCluster(boolean cluster) {
        this.cluster = cluster;
    }

    public String getAddrs() {
        return addrs;
    }

    public void setAddrs(String addrs) {
        this.addrs = addrs;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getAuth() {
        return auth;
    }

    public void setAuth(String auth) {
        this.auth = auth;
    }

    public int getMaxActive() {
        return maxActive;
    }

    public void setMaxActive(int maxActive) {
        this.maxActive = maxActive;
    }

    public int getMaxIdle() {
        return maxIdle;
    }

    public void setMaxIdle(int maxIdle) {
        this.maxIdle = maxIdle;
    }

    public int getMaxWait() {
        return maxWait;
    }

    public void setMaxWait(int maxWait) {
        this.maxWait = maxWait;
    }

    public boolean isUseDbnameAsPrefix() {
        return useDbnameAsPrefix;
    }

    public void setUseDbnameAsPrefix(boolean useDbnameAsPrefix) {
        this.useDbnameAsPrefix = useDbnameAsPrefix;
    }

    public String getPrefix() {
        return prefix;
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }

    public boolean isUseLowerCase() {
        return useLowerCase;
    }

    public void setUseLowerCase(boolean useLowerCase) {
        this.useLowerCase = useLowerCase;
    }

    public boolean isSaveNull() {
        return saveNull;
    }

    public void setSaveNull(boolean saveNull) {
        this.saveNull = saveNull;
    }

}
